<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
  <head>
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
	<link rel="stylesheet" href="css/custom/reset.css">
    <link rel="stylesheet" href="css/ui-base.css">
    <link rel="stylesheet" href="css/ui-box.css">
    <link rel="stylesheet" href="css/ui-color.css">
	<link rel="stylesheet" href="css/ui-res.css">
	<link rel="stylesheet" href="css/ui-media.css">
	<link rel="stylesheet" href="css/custom/base_640.css">
	<script src="js/jquery-1.8.0.min.js"></script>
    <script src="js/zy_control.js">
    </script>
    <script src="js/zy_click.js">
    </script>
    <script src="js/guoguojie.js">
    </script>
    <script src="js/iscroll.js">
    </script>
	<script src="js/jquery.promptumenu.min.js"></script>
	
  </head>
<body class="um-vp" ontouchstart>
	 <div class="content">
	 	<div  class="lb_wrap" id="lb_wrap">
	    	<div id="scroller">
	            <ul class="lunbo" id="lunbo">
	            </ul>
			</div>
		</div>
		<div class="product_show">
			<ul class="show" id="show_dpt">
			</ul>	
			
		</div>
		
    </div>
</body>
<script>
zy_init();
window.uexOnload=function(type)
{
	if(!type){
		uexWindow.setBounce("1");
		uexWindow.showBounceView("0","#FFF","0");
		uexWindow.showBounceView("1","#FFF","0");
		
		var winWid=$(window).width();
		
		$("#scroller").css({
			"width":winWid+"px"
		})
		$("#lunbo").find("li").css({
			"width":winWid+"px"
		});
		$("#lunbo").css({
			"width":winWid*4+"px"
		});
		
		loaded();
		uexWindow.toast(1, 5, "正在加载请稍后", 0);
		var ajaxId = Math.floor(Math.random() * 100);
		
		uexXmlHttpMgr.open(ajaxId, 'GET', domainName+"mobile/index.htm", 20000);
		uexXmlHttpMgr.onData = function(opcode, status, data){
			uexWindow.closeToast();
			if (status == -1){
				alert('网络连接出错，请检查网络!');
			}else if (status == 1){
				var ret = $.parseJSON(data);
				if(ret.success == 'true'){
					
					$.each(ret.dptList,function(index,item){
						var html='<li><a href="javascript:;" onclick="toPictorial(\''+item.id+'\')" class="pic"><img src="'+item.cover+'" class="block"/></a><a href="javascript:;" onclick="toPictorial(\''+item.id+'\')" class="title">'+item.name+'</a></li>';
						$("#show_dpt").append(html);
					});
					
					
					$.each(ret.bannerList,function(index,item){
						var link = item.hyperlink;
						var press = "";
						if(link.startWith("#")){
							link = link.substring(1);
							link = link.substring(0,link.length-1);
							press = 'onclick="toPictorial(\''+link+'\')"';
						}else{
							press= 'onclick="openBrowser(\''+link+'\')"';
						}
						
						var html='<li><a href="javascript:;" '+press+'><img src="'+item.picture+'" /></a></li>';
						$("#lunbo").append(html);
						
						
					});
					
					
				}
				
				uexXmlHttpMgr.close(ajaxId);
			}
		}
		uexXmlHttpMgr.send(ajaxId);
		
	}
	
}
function loaded() {
	myScroll = new iScroll('lb_wrap', {
		snap: true,
		momentum: false,
		hScrollbar: false,
		onScrollEnd: function () {
			//alert('aaaa');
		}
	 });
}

$(function(){
	var winWid=$(window).width();
	$("ul.lunbo li").css({
		width:winWid+"px"
	});
	var imgHei=parseInt(152*winWid/320);
	
	$("#lb_wrap").css({
		width:winWid*4+"px",
		height:imgHei+"px"
	});
	

	var cIndex=1;
	var lb=$("#lunbo");
	var lbLi=lb.find("li");
	var lbLiLen=lbLi.length;
	var st;
	function lbShow(){
		if(cIndex==lbLiLen){
			cIndex=0;
		}
		lb.animate({
			"left":-(cIndex*winWid)+"px"
		},function(){
			lbLi.eq(cIndex).addClass("current").siblings().removeClass("current");
			cIndex=cIndex+1;
		});
		
		st=setTimeout(lbShow,3000);
	}
	st=setTimeout(lbShow,3000);
	
	lb.bind("mouseover",function(){
		clearTimeout(st);
	});
	
	lb.bind("mouseout",function(){
		if(cIndex==lbLiLen){
			cIndex=0;
		}else{
			cIndex+=1;
		}
		st=setTimeout(lbShow,3000);
		
	});

});



//document.addEventListener('DOMContentLoaded', loaded, false);



</script>
</html>
